<template>
  <div id="app">
    <!--    <div id="nav">-->
    <!--      <router-link to="/">Home</router-link>-->
    <!--      <router-link to="/about">About</router-link>-->
    <!--      <router-link to="/first">第一练习页面</router-link>-->
    <!--      <router-link to="/second">第二练习页面</router-link>-->
    <!--      <router-link to="/third">第三练习页面</router-link>-->
    <!--    </div>-->
    <el-container>
      <el-aside class="aside">
        <el-menu :router="true" :default-active="$route.path">
          <template v-for="route in routes">
            <el-submenu
              v-if="route.children"
              :key="route.path"
              :index="route.path"
            >
              <template slot="title">
                <i class="el-icon-location"></i>
                <el-link :underline="false"> {{ route.title }}</el-link>
              </template>

              <el-menu-item
                v-for="rc in route.children"
                :key="rc.path"
                :index="rc.path"
              >
                <template slot="title">
                  <i class="el-icon-house"></i>
                  <el-link :underline="false"> {{ rc.title }}</el-link>
                </template>
              </el-menu-item>
            </el-submenu>
            <el-menu-item v-else :key="route.path" :index="route.path">
              <template slot="title">
                <i class="el-icon-dessert"></i>
                <el-link :underline="false"> {{ route.title }}</el-link>
              </template>
            </el-menu-item>
          </template>
        </el-menu>
      </el-aside>
      <el-main>
        <router-view />
      </el-main>
    </el-container>
  </div>
</template>
<script>
// import New from './components/New.vue';
import routes from "@/data/routeData";
export default {
  name: "App",
  components: {
    // New,Old,
  },
  props: {
    sampleP: {
      type: Number,
      default: 0,
    },
  },
  data() {
    return {
      sampleD: "value",
      routes: routes,
    };
  },
  computed: {
    // sampleC() {
    //     return this.sampleD+'--';
    // }
  },
  created() {},
  mounted() {},
  methods: {
    sampleM() {},
  },
  watch: {
    // sampleC(newValue, oldValue) {
    //
    // }
  },
};
</script>

<style lang="scss">
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  /*display: flex;*/
}

#nav {
  padding: 30px;
  width: 100px;
  display: flex;
  flex-direction: column;

  a {
    font-weight: bold;
    color: #2c3e50;
    margin: 20px;

    &.router-link-exact-active {
      color: #42b983;
    }
  }
}
.aside {
  width: 210px;
}
</style>
